package com.mall.common.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mall.common.dao.PaymentTypeDao;
import com.mall.common.domain.component.PaymentTypeDomain;
import com.mall.common.service.PaymentTypeService;


@Repository
public class PaymentTypeServiceImpl extends BaseServiceImpl<PaymentTypeDomain, Long> implements
		PaymentTypeService {
	
	@Resource
	public void setBaseDao(PaymentTypeDao paymentTypeDao) {
		super.setBaseDao(paymentTypeDao);
	}

	@Override
	@Transactional(propagation=Propagation.REQUIRED)
	public void save(PaymentTypeDomain paymentType) {
		if(paymentType.getId() == null){
    		persist(paymentType);
    	}else{
    		update(paymentType);
    	}
	}

}
